package com.cc;

import com.cc.config.SpringConfig;
import com.cc.dao.UserDao;
import com.cc.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );

        //创建IOC容器
        ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        /*UserDao userDao = ctx.getBean(UserDao.class);
        userDao.getList();*/

        UserService userService = ctx.getBean(UserService.class);

        userService.getList();
    }
}
